The user may declare input and output arguments of predicates using mode declarations. These declarations, for an n-ary predicate p, are of the form
For example, a 3-ary predicate p whose first argument is always a ground term in a call, whose second argument is always uninstantiated, and whose third argument can be any term, may have its mode declared as
part([], _, [], []). part([E|L], M, [E|U1], U2) :- E =< M, part(L, M, U1, U2). part([E|L], M, U1, [E|U2]) :- E > M, part(L, M, U1, U2). |